package cn.icatw.gulimall.auth.feign;

import cn.icatw.common.utils.R;
import cn.icatw.gulimall.auth.vo.SocialUser;
import cn.icatw.gulimall.auth.vo.UserLoginVo;
import cn.icatw.gulimall.auth.vo.UserRegisterVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 会员远程服务
 *
 * @author icatw
 * @date 2022/3/21
 * @email 762188827@qq.com
 * @apiNote
 */
@FeignClient("gulimall-member")
public interface MemberFeignService {
    /**
     * 注册
     *
     * @param vo 签证官
     * @return {@link R}
     */
    @PostMapping("member/member/register")
    R register(@RequestBody UserRegisterVo vo);

    /**
     * 登录
     *
     * @param vo 签证官
     * @return {@link R}
     */
    @PostMapping("member/member/login")
    R login(@RequestBody UserLoginVo vo);

    /**
     * oauthlogin
     *
     * @param socialUser 社会用户
     * @return {@link R}
     */
    @PostMapping("member/member/oauth2/login")
    R oauthlogin(@RequestBody SocialUser socialUser) throws Exception;
}
